/*
 * @Author: 0x9DEFA478
 * @Date: 2021-11-27 00:31:29
 * @LastEditTime: 2021-11-29 22:25:24
 * @LastEditors: 0x9DEFA478
 * @Description: 
 * QQ:2652450237
 * ============================================================================================================================================
 * 
 * 
 * 
 *                                                                                               ************      ****************************
 *                                                                                             ************      ****************************  
 *                                                                                           ************      ****************************    
 *                                                                                         ************      ****************************      
 *                                                                                       ************      ************                        
 *                                                                                     ************      ************                          
 *                                                                                   ************      ************                            
 *                                                                                 ************      ************                              
 *                                                                               ************      ************                                
 *                                                                             ************      ************                                  
 *                                                                           ************      ************                                    
 *                                                                         ************      ************                                      
 *                                                                       ************      ************                                        
 *                                                                     ************      ************                                          
 *                                                                   ************      ************                                            
 *                                                                 ************      ************                                              
 *                                                               ************      ************                                                
 *                                                             ************      ************                                                  
 *                                                           ************      ************                                                    
 *                                                         ************      ************                                                      
 *                                                       ************      ************                                                        
 *                                                     ************      ************                                                          
 *                                                   ************      ************                                                            
 *                                                 ************      ************                                                              
 *                                               ************      ************                                                                
 *                                             ************      ************                                                                  
 *                                           ************      ************                                                                    
 *                                         ************      ************                                                                      
 *                                       ************      ************                                                                        
 *                                     ************      ************                                                                          
 *                                   ************      ************                                                                            
 *                                 ************      ************                                                                              
 *                               ************      ************                                                                                
 *                             ************      ************                                                                                  
 *                           ************      ************                                                                                    
 *                         ************      ************                                                                                      
 *       ****************************      ************                                                                                        
 *     ****************************      ************                                                                                          
 *   ****************************      ************                                                                                            
 * ****************************      ************                                                                                              
 * 
 * 
 * 
 * ============================================================================================================================================
 * 
 */
#include "mdma.h"
#include "Peripherals_Instence.h"
#include "MemoryMalloc.h"


#define MDMA_Handle_MemoryMalloc                                  MemoryMalloc_DTCM



void MDMA_Init(){

  RCC->AHB3ENR|=RCC_AHB3ENR_MDMAEN;


  ip_mdma_golbal=MDMA_Handle_MemoryMalloc.Malloc(sizeof(IP_MDMA_Golbal));
  if(cH_IsNull(ip_mdma_golbal)){
    for(;;){
    }
  }

  extern void MDMA_SetIrqCallback(void (*IP_IRQ_Callback)(void*),void* v);
  MDMA_SetIrqCallback(IP_MDMA_IRQ,ip_mdma_golbal);

  IP_MDMA_GlobalInit(ip_mdma_golbal,MDMA);

  HAL_NVIC_SetPriority(MDMA_IRQn,7,0);
  HAL_NVIC_EnableIRQ(MDMA_IRQn);

}


